<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ page import="com.hzqy.commons.utils.ConstantUtils" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>保洁时间增加</title>
<link rel="stylesheet" type="text/css"	href="../static/js/themes/defalut.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/public.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/ddspstyle.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"	href="../static/js/themes/icon.css">
<link rel="stylesheet" type="text/css"	href="../static/js/WdatePicker/skin/WdatePicker.css">
<script type="text/javascript" src="../static/js/jquery.min.js"></script>
<script type="text/javascript" src="../static/js/jquery.easyui.min.js"></script>
<script type="text/javascript"	src="../static/js/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="../static/js/jquery.validate.js"></script>
<script type="text/javascript" src="../static/js/index.js"></script>
<script type="text/javascript" src="../static/js/WdatePicker/WdatePicker.js"></script>
<script type="text/javascript" charset="utf-8" src="../ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="../ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="../ueditor/lang/zh-cn/zh-cn.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<%
String []nonceObj=ConstantUtils.getNonceObject();
%>
<script type="text/javascript">
/* $(function(){
		$.ajax({
			url:"../pms/org_list.do",
			success:function(data) {
				data = JSON.parse(data);
				var str = "";
				for(var i=0;i<data.length;i++) {
					str+='<option value="'+data[i].id+'">'+data[i].name+'</option>';
				}
				$("#f_cc_companyid").append(str);
			}
		});
	});	 */
	$(function() {
		$("#contentForm").validate({
			rules: {
				f_cc_name: {
					required: true,
					maxlength: 50
				},
				f_cc_searchname:{
					required: true,
					maxlength: 50
				},
				f_cc_companyname: {
					required: true
				},
				f_cc_interfaceType:{
					required: true
				},
				f_cc_obligate1: {
					required: true,
				}
				
			},
			messages: {
				f_cc_name: {
					required: "请输入房间号",
					maxlength: "房间号不能超过50位"
				},
				f_cc_searchname:{
					required: "请输入机顶盒账号",
					maxlength: "机顶盒账号不能超过50位"
				},
				f_cc_companyname:{
					required: "请选择组织",
				},
				f_cc_interfaceType:{
					required: "请选择第几次保洁",
				},
				f_cc_obligate1: {
					required: "请选择保洁星期",
				}
			}
			
		});
		
		try{
			var ue = UE.getEditor('f_cc_desc');
		}catch(e){
			console.info(e);
		}
		
	});
	function bind() {
		openDialog($('#dlg'),'org_bind.jsp?chooseid='+$("#f_cc_company_id").val());
	}

	function _submitFm() {
		var definitionflag = 0;
		$('input[name="definitionflag"]').each(function(idx, ele){
			definitionflag += $(this).is(':checked')?parseInt($(this).val()):0;
		});
		$('#f_cc_definitionflag').val(definitionflag);
		arrayToJson();
		if($("#contentForm").validate().form()) {
		app_ajax('insert_content.do', $("#contentForm").serialize(), function(data) {
				if (data.success) {
					$.messager.progress('close');
					$.messager.alert('提示', '提交成功！', 'info', function() {
						parent.$('#dlg').dialog('close');
						parent.gotoSearch($('#easyui-treegrid'));
					});
				} else {
					$.messager.alert('提示', data.result, 'info', function() {
						$.messager.progress('close');
					});
				}
		});
	  }
	}
	
	
	var open = true;
	function moreItemSwitch(){
		if(open){
			$(".hide-item").hide();
			$("#switchItemBtn").find(".l-btn-text").text("显示更多内容");
			$("#switchItemBtn").find(".l-btn-icon.icon-remove").removeClass("icon-remove").addClass("icon-add");
		}else{
			$(".hide-item").show();
			$("#switchItemBtn").find(".l-btn-text").text("隐藏更多内容");
			$("#switchItemBtn").find(".l-btn-icon.icon-add").removeClass("icon-add").addClass("icon-remove");
		}
		open = !open;
	}
	
	function castSelect(id){
		openDialog($('#cast_list'),'content_cast.jsp?id='+id);
	}
	
	function bind() {
		openDialog($('#dlg'),'org_bind.jsp?chooseid='+$("#f_cc_company_id").val());
	}
	
</script>
<style type="text/css">
</style>
</head>

<body class="overfwidth">
	<div class="barnavtop">您所在的位置：保洁人员配置 &gt; 保洁时间配置</div>
	<div id="workspace">
		<!--主体 开始-->
		<div id="container-1">
			<div class="editspace">
				<form id="contentForm" class="cmxform" enctype="multipart/form-data" name="formName">
					<input type="hidden" id="f_cc_isfree" name="f_cc_isfree" value="0"/>
					<input type="hidden" id="f_cc_definitionflag" name="f_cc_definitionflag" value=""/>
					<input type="hidden" id="f_cast_id" name="f_cast_id" value=""/>
					<input id="f_cc_status" name="f_cc_status" type="hidden" value="1" />
					<input id="f_cc_onlinedate" name="f_cc_onlinedate" type="hidden" value="2019-01-11" />
					<input id="f_cc_offlinedate" name="f_cc_offlinedate" type="hidden" value="2019-01-11" />
					<input id="f_cc_type" name="f_cc_type" type="hidden" value="24">
					<input type="hidden" name="stime" value="<%=nonceObj[0]%>"/>
					<input type="hidden" name="sign" value="<%=nonceObj[1]%>"/>
					<legend style="text-align: center; margin: 0 auto;">内容新增</legend>
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>房间号
									</td>
									<td width="30%">
										<input id="f_cc_name" name="f_cc_name" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_cc_name_tip" class="tip"></span>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>机顶盒账户
									</td>
									<td width="30%">
										<input id="f_cc_searchname" name="f_cc_searchname" style="width: 150px;" value="" class="yl_inp yw_name" />
										<span id="f_cc_searchname" class="tip"></span>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										<span class="red">*</span>组织选择:
									</td>
									<td width="30%">
										<input name="f_cc_companyname" id="f_cc_company_name" readonly="readonly"	style="width: 150px;" value="" class="yl_inp yw_name" />
										<input name="f_cc_companyid" id="f_cc_company_id" type="hidden" value="" />  
										<input name="status" id="status" type="hidden" value="nochange" />  
										<!-- <select id="f_cc_companyid" name="f_cc_companyid" style="width: 150px;">
										</select> -->
										<!-- <span id="f_cc_companyid_tip" class="tip"></span> -->
										<a id="12" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0);"
											onclick="bind();">选择</a>
									</td>
									
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										第几次清扫：
									</td>
									<td width="30%">
										<select name="f_cc_interfaceType" id="f_cc_interfaceType" style="width: 150px;">
										<option value="1">第一次清扫</option>
										<option value="2">第二次清扫</option>
										</select>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					<fieldset>
						<div class="fitem">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="20%" align="right">
										清扫星期：
									</td>
									<td width="30%">
										<select name="f_cc_obligate1" id="f_cc_obligate1" style="width: 150px;">
										<option value="星期日">星期日</option>
										<option value="星期一">星期一</option>
										<option value="星期二">星期二</option>
										<option value="星期三">星期三</option>
										<option value="星期四">星期四</option>
										<option value="星期五">星期五</option>
										<option value="星期六">星期六</option>
										</select>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					
					<fieldset >
						<div class="fitem" style="display: none">
							<table width="100%" border="0" cellpadding="0" cellspacing="0">
								<tr>
									<td width="40%" align="right">
										<jsp:include page="../pictures/pictures_add.jsp" flush="true">
											<jsp:param value="内容" name="picType"/>
										</jsp:include>
									</td>
								</tr>
							</table>
						</div>
					</fieldset>
					
					
					<div class="toolbar" style="text-align: center;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
							href="javascript:void(0);" onclick="_submitFm()">保存</a> <a
							href="javascript:void(0);" data-options="iconCls:'icon-cancel'"
							class="easyui-linkbutton"
							onclick="javascript:parent.$('#dlg').dialog('close')">取消</a>
					</div>
				</form>
			</div>
		</div>
		<!--主体 结束-->
		
		
	</div>
	<div id="cast_list" class="easyui-dialog"
		style="width: 600px; height: 470px; padding-top: 0px;"
		data-options="title:'模型选择', iconCls:'icon-save',modal:true,closed:true,buttons:'#dlg_buttons'">
		<iframe scrolling="auto" frameborder="0"
			style="width: 100%; height: 99%;"></iframe>
	</div>
	<div id="dlg" class="easyui-dialog"
		style="width: 800px; height: 500px; padding-top: 0px;"
		data-options="title:'企业管理', iconCls:'icon-save',modal:true,closed:true,buttons:'#dlg_buttons'">
		<iframe scrolling="auto" frameborder="0"
			style="width: 100%; height: 99%;"></iframe>
	</div>
</body>
</html>
